<?php $public_dir = dirname(__FILE__);

define('BUILD',1);

$start_time = microtime(true);
$files_extension = '.php';
$public_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
$sites_dir = '..' . DIRECTORY_SEPARATOR . 'Sites' . DIRECTORY_SEPARATOR;
$system_dir = '..' . DIRECTORY_SEPARATOR . 'System' . DIRECTORY_SEPARATOR; //Must be valid for run framework
$temp_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Temp' . DIRECTORY_SEPARATOR;

require_once($system_dir . '.Initialize.php');

/* Notes:
 * In dir names $ means auto detect, Config directory OR System directory
 */
$core_settings = array(
	//App
	'app.multisites' => true,
	'app.path' => $sites_dir,
	'app.public.path' => $public_dir,
	//Cache
	'cache.path' => $temp_dir . 'Cache',
	'cache.system.path' => $system_dir . 'SysCache',
	//Configure store
	'confg.multisites' => true,
	'confg.store.path' => $sites_dir,
	'confg.store.filename' => 'Base.sqlite',
	'confg.store.type' => 'SQLite3',
	//Cookies
	'cookies.domain' => $_SERVER['HTTP_HOST'],
	'cookies.httponly' => false,
	'cookies.lifetime' => '5 minutes',
	'cookies.path' => '/',
	'cookies.secure' => false,
	//Cookies(encrypted)
	'cookies.cipher' => MCRYPT_RIJNDAEL_256,
	'cookies.cipher_mode' => MCRYPT_MODE_CBC,
	'cookies.encrypt' => true,
	'cookies.secret_key' => 'CHANGE_ME',
	'cookies.user_id' => 'DEFAULT',
	//Debugging
	'debug' => false,
	//Input/Output
	'io.ds' => DIRECTORY_SEPARATOR,
	//Logging
	'log.enable' => true,
	'log.level' => 4,
	'log.logger' => null,
	'log.path' => $temp_dir . 'Logs',
	//System
	'system.path' => $system_dir,
	//Temp
	'temp.path' => $temp_dir,
	'temp.upload.path' => $temp_dir . 'Files',
	//View
	'templates.path' => '$/Extensions/Themes',
	'templates.view' => 'SmartyView',
);

using('System');
Config::Import($core_settings); // OR Config::Load();
App::Create();
App::Run('development');

echo(number_format((microtime(true) - TS), 5)."<br />\n");